<template>
    <div>
        <img :src="baseImgeUrl + imgUrl" style="width: 50px;height: 50px;" @click="showImg(baseImgeUrl + imgUrl)"
            v-if="imgUrl && imgType=='image'" />

        <Modal v-model="imgShow" title="查看图片" width="40">
            <img :src="imgShowUrl" style="width: 100%;height: 100%;">
        </Modal>
    </div>
</template>
<script>
import config from "@/config";
const baseImgeUrl = process.env.NODE_ENV === "development" ? config.baseImgUrl.dev : config.baseImgUrl.pro;
export default {
    name: 'showImg',
    props: {
        imgType: {
            type: String,
            default: "image"
        },
        imgUrl: {
            type: String,
            default: ""
        },
    },

    data() {
        return {
            baseImgeUrl: baseImgeUrl,
            imgShow: false,
            imgShowUrl: '',
        }
    },
    methods: {
        showImg(url) {
            this.imgShowUrl = url;
            this.imgShow = true;
        },
    },
}
</script>
